<p class="p-modal">Edit jabatan <span class="t-hijau-dark"><?php foreach ($list as $row_aj){echo $row_aj->jabatan;}?></span></p>
<div class="isi-modal">
	<?php 
		echo form_open('a_jabatan/update', array('id' => 'UpdateAturJabatan')); 
		foreach ($list as $row){ 
	?>
		<div class="row">
			
			<div class="col-md-12">
			<input type="hidden" name="id_a_jabatan" value="<?php echo $row->id_a_jabatan;?>"/>
			<select name="id_m_pegawai" class="form-control form-elba input-sm" <?php if(count($list_p)<1){echo "disabled";}?>>
				<?php 
				if(count($list_p)>0){
					foreach ($list_p as $row_p){ 
					
						if($row_p->id_m_pegawai==$list[0]->id_m_pegawai){
						?>
							<option selected value="<?php echo $row_p->id_m_pegawai; ?>"><?php echo $row_p->nama_lengkap; ?></option>
						<?php
						}else{
						?>
							<option value="<?php echo $row_p->id_m_pegawai; ?>"><?php echo $row_p->nama_lengkap; ?></option>							
						<?php
						}
					};
				}else{
				?>
							<option value="null">Tidak ada data</option>
				<?php
				}
				?>
			</select><br/>
			<div class="input-daterange input-group">
				<input type="text" value="<?php echo date('d/m/Y', strtotime($row->mulai));?>" class="form-control form-elba input-sm clearable" name="mulai" readonly placeholder="Mulai menjabat"/>
				<span class="input-group-addon group-addon-elba-tengah group-addon-elba b-hijau-muda">sd</span>
				<input type="text" value="<?php echo date('d/m/Y', strtotime($row->akhir));?>" class="form-control form-elba input-sm clearable" name="akhir" readonly placeholder="Akhir menjabat"/>
			</div><br/>
			</div>

		</div><br/><br/>

		<span id="loadingAdd" style="display:none;">Sedang memproses..</span>
		<span id="errorAdd" style="display:none;color:red;">Ma'af, gagal mengupdate data</span>
		
		<span class="pull-right">
			<button type="submit" id="saveButton" class="btn btn-xs tmb-utama <?php if(count($list_p)<1){echo "sembunyi";}?>"> Update</button> 
			<button class="btn tmb-kedua close-reveal-modal close-modal"> Batal</button>
		</span>

	<?php 
		}
		echo form_close();
	?>	
</div>